<?php
//1. strlen($str) 返回字符串的长度
$str = "Hello world adiljan programmer";
$len = strlen($str);
echo $len;
echo "<hr>";

$ind = strpos($str,"world");
echo $ind;
echo "<hr>";

$num = str_word_count($str);
echo $num;
echo "<hr>";

$str_rev = strrev($str);
echo $str_rev;
echo "<hr>";

$str_rep = str_replace('adiljan','ahtar',$str);
echo $str_rep;
echo "<hr>";

$arr = ["A","B","C","D"];
$arrstr = implode("!",$arr);
//$arrstr = join("!",$arr);
echo $arrstr;
echo "<hr>";


$s = "        Hello      World         !    
    
    ";
echo strlen($s);
echo "<br>";
$trimstr = trim($s);
echo strlen($trimstr);
echo "<br>";
echo "<pre>".$trimstr."</pre>";
echo "<hr>";

$m = md5($str);
echo $m;
echo "<hr>";

$low = strtolower($str);
echo $low;
echo "<hr>";

$low=strtoupper($str);
echo $low;
echo "<hr>";

$n = substr_count($str,"world");
echo $n;